package com.example.androidapp2;

import com.example.androidapp2.DbClasses.Utils;
import com.xyzdesa.droidnomy.R;
import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;

public class PopUpAyuda  extends Dialog  {
	public ImageButton btnFacebook;
	public Button btnAyuda;
	public Context Ctx;

	public PopUpAyuda(Context context) {
		super(context);
		Ctx = context;
		this.setContentView(R.layout.pup_ayuda);
		
		this.setTitle(Ctx.getResources().getString(R.string.itmAyuda));
		
		btnFacebook = (ImageButton) findViewById(R.id.btnFacebook);
		btnAyuda= (Button) findViewById(R.id.ibtnAyuda);
		SetListeners();
	}
	
	private void SetListeners()
	{	
		btnFacebook.setOnClickListener(new View.OnClickListener() {
			public void onClick(View v) 
			{
				Uri uri = Uri.parse(Utils.UrlFacebook);
				Intent browserIntent = new Intent(Intent.ACTION_VIEW).setData(uri);
				browserIntent.setClassName("com.android.browser", "com.android.browser.BrowserActivity");
				Ctx.startActivity(browserIntent);				
			}
		});
		
		btnAyuda.setOnClickListener(new View.OnClickListener() {
			public void onClick(View v) 
			{
				Uri uri = Uri.parse(Utils.UrlAyuda);
				Intent browserIntent = new Intent(Intent.ACTION_VIEW).setData(uri);
				browserIntent.setClassName("com.android.browser", "com.android.browser.BrowserActivity");
				Ctx.startActivity(browserIntent);				
			}
		});
	}
}
